package com.me.study.designPatterns.bDecorator;

import org.junit.Test;

/**
 * 装饰者模式：一个顶级的组件抽象，一个具体的组件实现，一个继承组件抽象的装饰类抽象（持有具体组件的引用），N个装饰实现类
 *
 * @author ME
 * @date   2019/4/4
 */
public class TestDecorator {

    @Test
    public void TestDecorator() {
        Someone someone = new Xiaoming();
        someone = new FirstDecorator(someone);
        someone = new HandsomeDecorator(someone);
        someone = new StrongDecorator(someone);
        someone.say();
    }
}
